﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;

namespace MessMain
{
    static class Program
    {
        public static string name;
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            // Read config
            XMLParser xmlparser = new XMLParser(@"C:\Configurare.xml");
            Dictionary<string, string> dict = xmlparser.ExtractAttributePairs("Configurare", string.Empty, string.Empty, "name", "formula");


            // Start app
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new LoginForm(dict["ServerMessIP"], dict["ServerMessPort"], dict["Limba"]));
            if(name!=null )
                Application.Run(new Comunication(dict["Limba"],
                                            dict["ServerMessIP"],
                                            dict["ServerMessPort"],
                                            dict["FTPIp"],
                                            dict["FTPPort"],
                                            dict["FTPUser"],
                                            dict["FTPParola"],
                                            name));

        }       
    }
}
